import threading, time


class book():
    ID = None
    Chapters = []

    def __init__(self, type1, name1, author1, href1, source, utime):
        self.type1 = type1
        self.name = name1
        self.author = author1
        self.href = href1
        self.source = source
        self.utime = utime

    def PrintInfo(self):
        print("{0},{1},{2},{3},{4},{5}".format(self.type1, self.name, self.author, self.href, self.source, self.utime))


# 章节类
class Section():
    def __init__(self, num1, name1, href1, zw):
        self.num = num1
        self.name = name1
        self.href = href1
        self.MainBody = zw

    def PrintInfo(self):
        print("{0},{1}".format(self.num, self.href))


class PublicTable():
    def __init__(self, name, state, isalive):
        self.Name = name
        self.State = state
        self.IsAlive = isalive

    def PrintInfo(self):
        print("{0},{1},{2}".format(self.Name, self.State, self.IsAlive))


class MyThread():
    def __init__(self, ID, IsFinish, Priority, Type, Params):
        self.ID = ID
        self.IsFinish = IsFinish
        self.Priority = Priority
        self.Type = Type
        self.Params =Params


# class MyThread(threading.Thread):
#     def __init__(self, func, args=()):
#         super(MyThread, self).__init__()
#         self.func = func
#         self.args = args
#
#     def run(self):
#         time.sleep(1)
#         self.result = self.func(*self.args)
#
#     def get_result(self):
#         threading.Thread.join(self)  # 等待线程执行完毕
#         try:
#             return self.result
#         except Exception:
#             return None
